import { loginAuthStorage } from "@/utils/storage";
import { redirect } from "react-router-dom";

/** 布局页loader */
export function layoutLoader() {
  const token = loginAuthStorage.getToken();
  if (!token) {
    return redirect('/login')
  }

  return { token }
}